//基本类型
let a:string="yj"
let b:number=12
let c:boolean=true
let d:any=34//不安全
console.log(d.toFixed(2))
let e:unknown=45//安全
if(typeof e==="number"){
    console.log(e.toFixed(2))
}
let f:null=null
let g:undefined=undefined

//void,never
function add():void{
    console.log("12")
}
function add1():never{
    throw new Error("Error")
}

//引用类型
let arr:number[]=[12,4,5]
let arr1=[2,4,"skd",true]
let arr2:string[]=["sad","fyj"]

//object
let person:object={
    name:"sa",
    age:18
}

interface Per{
    name:string,
    age:number
    height?:number
}

let p1:Per={
    name:"dja",
    age:19
}

let p2:{name:string,age:number,height?:number}={
    name:"bod",
    age:20
}

function login(p:Per):void{
    console.log(p)
}